package com.shd.edanpei.customer.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseQuickImageAdapter;
import com.shd.edanpei.bean.DataBean;

/**
 * Created by mc on 2018/9/28.
 * yang-wen-wen
 */

public class ListAdapter extends BaseQuickImageAdapter<DataBean> {

    public ListAdapter(Context context) {
        super(context, R.layout.item_list);
    }

    @Override
    protected void convert(BaseViewHolder helper, DataBean item) {
        if (item.isTop()) {
            helper.getView(R.id.big_title).setVisibility(View.VISIBLE);
            helper.setText(R.id.big_title, item.getBigTitle());
            helper.getView(R.id.tv_des).setVisibility(View.GONE);
            helper.getView(R.id.tv_str).setVisibility(View.GONE);
        } else {
            helper.getView(R.id.big_title).setVisibility(View.GONE);
            helper.getView(R.id.tv_des).setVisibility(View.VISIBLE);
            helper.getView(R.id.tv_str).setVisibility(View.VISIBLE);
            helper.setText(R.id.tv_des, item.getLeftStr())
                    .setText(R.id.tv_str, item.getRightStr());
        }
    }
}
